Skip to content

feat(cypher): expose labels and type for fixed-length relationships - #235

Open
MuddyBootsCode wants to merge 5 commits into
hyperdimensionalcomputingai:mainfrom
MuddyBootsCode:codex/217-fixed-relationship-labels
Open

MuddyBootsCode wants to merge 5 commits into
hyperdimensionalcomputingai:mainfrom
MuddyBootsCode:codex/217-fixed-relationship-labels

Conversation

@MuddyBootsCode

@MuddyBootsCode MuddyBootsCode commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #217. For a fixed-length relationship, labels(r) returns a one-item list containing its configured type, and type(r) returns that same name as a string. A single query can now return the holder, interest type and fraction for every matching edge, even when a holder has two different interests in the same tract.

MATCH (holder:Entity)-[i]->(t:Entity {id: 3})
RETURN holder.id AS holder, type(i) AS interest, i.fraction AS fraction
ORDER BY holder, interest

Problem and why it matters

On the original baseline, type(i) raised an unimplemented-function error, and labels(i) rejected a relationship. The workaround repeated the query once per configured type with UNION ALL. A type-list pattern also lost the name of the table that supplied each row. The endpoints alone cannot distinguish two relationships connecting the same pair of nodes.

Change

Both functions read the same configured label. Relationship records already carry it in their Arrow identity. For flat typed expansions, the planner carries it through the union only when the query requests it. The type follows a WITH rename, and both functions return null for an unmatched OPTIONAL MATCH. The integration with #230 keeps a property-filtered optional hop eligible for a single outer CSR expansion, including when the projection returns the type.

Validation

Local checks ran on the published head 162e9d4.

Suite Passed Skipped or ignored
Rust workspace 765 11 ignored
Python, including doctests 1,882 5 skipped
Node 90 0

Rust formatting, Clippy with warnings denied, Ruff, Python formatting and Pyright passed. All nine upstream CI checks passed on this head. GitHub checks

The issue fixture returns both the 2% overriding royalty and 50% mineral interest for holder 1, and the full working interest for holder 2. Regression coverage includes single-type, type-list and untyped patterns, CSR on and off, Arrow and Lance, properties named type or label, user aliases, filters, ordering, and optional null rows. The integration test also checks matching and rejected predicates inside the optional clause.

Benchmarks

Compared release wheels from main 7d92e10 and this branch at 162e9d4. The two SF1 runners and the large shape suite ran twice per wheel in each storage mode on the same Apple M5 Max, 128 GiB, macOS 27.0.1, Rust 1.96.0. The runners loaded the verified native library from each wheel. The large graph used seed 0, 200,000 accounts and 2,338,886 T edges. All 352 SF1 answer checks and 400 shape cases passed, including required operators.

Percentages are geometric means of per-query latency ratios. Positive is slower. The last column measures variation between two runs of the same main build.

Suite Mode Queries Branch vs main Main repeat vs first
graph-benchmark-ldbc memory 30 -1.8% +2.6%
graph-benchmark-ldbc lazy 30 -0.1% -1.0%
graph-benchmark-ldbc-complex memory 14 +1.1% +0.5%
graph-benchmark-ldbc-complex lazy 14 -0.1% -1.6%
shapes memory 50 +0.6% +0.2%
shapes lazy 50 +0.1% +0.2%

The slower query and its rerun

In the original comparison (1d01a8d → 6afaaf1), the in-memory cross_filter_ids shape was the only case more than 20% slower. We reran it in four fresh processes with the same data and runner settings.

In-memory cross_filter_ids Main 1 Branch 1 Main 2 Branch 2 Branch vs main
Original suite (ms) 2.240 3.224 2.250 2.598 +29.7%
Fresh-process rerun (ms) 2.236 2.705 2.271 2.234 +9.6%

The repeat was still 9.6% slower on average. Its second branch measurement was slightly faster than both main measurements. The full execution plans matched, and the original 29.7% gap did not repeat.

After integrating the upstream planner changes, we ran the same query against main 7d92e10 and the published head 162e9d4. The four fresh-process measurements are in milliseconds.

Mode Query Initial change Main 1 Branch 1 Main 2 Branch 2 Repeat change
memory cross_filter_ids -5.3% 2.432 2.282 2.615 2.225 -10.7%

No SF1 query exceeded the 20% slowdown threshold in the updated comparison.

On the published head, cross_filter_ids was 5.3% faster in the full suite and 10.7% faster in the fresh-process rerun. The original slowdown did not reproduce. These measurements fall inside the project's stated run-to-run variation. No query in any of the three updated suites crossed the 20% slowdown threshold.

We also compared the full EXPLAIN output for all 188 query/mode combinations. The first captures matched byte for byte for 187. The exception was complex SF1 query 3 in lazy mode, where two country filters printed in a different order. Each build reproduced the other build's exact plan in a fresh process. All 16 control query/mode combinations on the fixed-length fixture had identical plans across four captures.

Cost of asking for relationship types

On 30,000 relationships with in-memory CSR, the three-way manual UNION ALL took 1.18 ms, a single type-list query returning both type(r) and labels(r) took 1.52 ms, and the untyped form took 10.50 ms. All produced the same rows. The untyped plan already used PathMatchExec and took 9.63 ms to read just the share on the branch. These are warmed measurements.

graph-benchmark-ldbc · all queries in both modes

memory

Query Main 1 ms Main 2 ms Branch 1 ms Branch 2 ms Mean change Baseline repeat change
test_benchmark_query1 0.747 0.779 0.710 0.710 -6.9% +4.3%
test_benchmark_query2 0.604 0.736 0.599 0.579 -12.1% +22.0%
test_benchmark_query3 0.701 0.771 0.702 0.681 -6.1% +10.1%
test_benchmark_query4 0.562 0.586 0.577 0.558 -1.2% +4.3%
test_benchmark_query5 1.037 1.045 1.065 1.201 +8.9% +0.8%
test_benchmark_query6 0.507 0.504 0.483 0.485 -4.4% -0.5%
test_benchmark_query7 1.404 1.263 1.232 1.225 -7.9% -10.1%
test_benchmark_query8 0.816 0.825 0.943 0.789 +5.5% +1.0%
test_benchmark_query9 0.935 0.956 0.967 0.917 -0.3% +2.2%
test_benchmark_query10 0.922 0.973 0.909 0.891 -5.0% +5.5%
test_benchmark_query11 1.641 1.910 1.690 1.632 -6.5% +16.4%
test_benchmark_query12 0.783 0.809 0.822 0.763 -0.5% +3.3%
test_benchmark_query13 0.849 0.855 0.851 0.902 +2.9% +0.7%
test_benchmark_query14 0.597 0.605 0.618 0.705 +10.1% +1.4%
test_benchmark_query15 0.650 0.645 0.633 0.620 -3.2% -0.8%
test_benchmark_query16 0.884 0.745 0.727 0.724 -10.9% -15.7%
test_benchmark_query17 1.086 1.069 1.193 1.072 +5.1% -1.5%
test_benchmark_query18 0.742 0.752 0.864 0.740 +7.4% +1.3%
test_benchmark_query19 1.101 1.182 1.132 1.107 -1.9% +7.3%
test_benchmark_query20 1.469 1.807 1.461 1.456 -10.9% +23.0%
test_benchmark_query21 0.849 0.827 0.815 0.857 -0.3% -2.6%
test_benchmark_query22 0.788 0.878 0.787 0.914 +2.1% +11.4%
test_benchmark_query23 0.840 0.875 0.834 0.891 +0.6% +4.2%
test_benchmark_query24 0.787 0.793 0.769 0.751 -3.8% +0.7%
test_benchmark_query25 0.961 0.893 0.888 0.860 -5.7% -7.0%
test_benchmark_query26 0.923 0.828 0.992 0.810 +2.9% -10.3%
test_benchmark_query27 0.913 0.914 0.943 0.902 +0.9% +0.1%
test_benchmark_query28 1.439 1.618 1.432 1.436 -6.2% +12.5%
test_benchmark_query29 0.777 0.817 0.790 0.766 -2.4% +5.1%
test_benchmark_query30 9.834 9.700 9.276 10.575 +1.6% -1.4%

Geometric mean of per-query branch/main ratios: 0.9823.

lazy

Query Main 1 ms Main 2 ms Branch 1 ms Branch 2 ms Mean change Baseline repeat change
test_benchmark_query1 1.259 1.375 1.216 1.513 +3.6% +9.1%
test_benchmark_query2 1.391 1.438 1.423 1.462 +2.0% +3.4%
test_benchmark_query3 0.849 0.887 0.827 0.854 -3.2% +4.4%
test_benchmark_query4 1.007 0.957 0.938 0.992 -1.7% -5.0%
test_benchmark_query5 2.035 2.006 2.013 2.089 +1.5% -1.5%
test_benchmark_query6 0.767 0.750 0.733 0.772 -0.7% -2.2%
test_benchmark_query7 1.309 1.304 1.278 1.262 -2.8% -0.4%
test_benchmark_query8 1.905 1.559 1.581 1.562 -9.3% -18.2%
test_benchmark_query9 1.343 1.547 1.640 1.297 +1.6% +15.2%
test_benchmark_query10 1.163 1.438 1.159 1.455 +0.5% +23.7%
test_benchmark_query11 2.140 2.106 2.065 2.138 -1.0% -1.6%
test_benchmark_query12 4.580 4.498 4.464 4.530 -0.9% -1.8%
test_benchmark_query13 1.274 1.213 1.216 1.251 -0.8% -4.8%
test_benchmark_query14 0.725 0.735 0.759 0.711 +0.7% +1.3%
test_benchmark_query15 0.974 0.890 0.879 0.879 -5.7% -8.6%
test_benchmark_query16 1.222 1.035 1.157 1.127 +1.2% -15.3%
test_benchmark_query17 1.837 1.911 2.389 1.784 +11.4% +4.1%
test_benchmark_query18 1.535 1.674 1.474 1.730 -0.2% +9.1%
test_benchmark_query19 1.607 1.599 1.622 1.640 +1.7% -0.5%
test_benchmark_query20 39.830 40.058 40.816 40.552 +1.9% +0.6%
test_benchmark_query21 0.907 0.837 0.935 0.879 +4.0% -7.7%
test_benchmark_query22 1.100 1.029 1.066 1.039 -1.1% -6.5%
test_benchmark_query23 1.242 1.247 1.246 1.218 -1.0% +0.4%
test_benchmark_query24 1.389 1.089 1.092 1.035 -14.2% -21.6%
test_benchmark_query25 1.366 1.528 1.647 1.372 +4.3% +11.9%
test_benchmark_query26 1.111 1.243 1.075 1.480 +8.5% +11.9%
test_benchmark_query27 1.482 1.454 1.483 1.555 +3.5% -1.9%
test_benchmark_query28 2.084 1.984 2.065 1.994 -0.2% -4.8%
test_benchmark_query29 1.248 1.106 1.162 1.122 -3.0% -11.3%
test_benchmark_query30 11.021 11.258 11.084 10.799 -1.8% +2.1%

Geometric mean of per-query branch/main ratios: 0.9986.

graph-benchmark-ldbc-complex · all queries in both modes

memory

Query Main 1 ms Main 2 ms Branch 1 ms Branch 2 ms Mean change Baseline repeat change
test_benchmark_query1 24.229 23.615 23.763 23.844 -0.5% -2.5%
test_benchmark_query2 2.607 2.638 3.357 2.776 +16.9% +1.2%
test_benchmark_query3 21.950 21.315 22.756 21.545 +2.4% -2.9%
test_benchmark_query4 6.334 6.321 6.181 6.427 -0.4% -0.2%
test_benchmark_query5 41.857 40.940 41.736 40.438 -0.8% -2.2%
test_benchmark_query6 21.117 22.134 21.516 23.715 +4.6% +4.8%
test_benchmark_query7 9.684 9.714 9.687 9.482 -1.2% +0.3%
test_benchmark_query8 2.733 2.451 2.478 2.446 -5.0% -10.3%
test_benchmark_query9 35.768 39.487 38.821 35.979 -0.6% +10.4%
test_benchmark_query10 13.358 13.719 13.484 15.356 +6.5% +2.7%
test_benchmark_query11 3.114 3.126 3.120 3.214 +1.5% +0.4%
test_benchmark_query12 16.438 15.358 16.373 16.330 +2.9% -6.6%
test_benchmark_query13 1.173 1.372 1.174 1.157 -8.4% +16.9%
test_benchmark_query14 249.804 245.905 243.280 252.403 -0.0% -1.6%

Geometric mean of per-query branch/main ratios: 1.0113.

lazy

Query Main 1 ms Main 2 ms Branch 1 ms Branch 2 ms Mean change Baseline repeat change
test_benchmark_query1 34.044 35.403 36.167 36.823 +5.1% +4.0%
test_benchmark_query2 25.123 25.274 26.280 25.412 +2.6% +0.6%
test_benchmark_query3 166.924 163.652 156.758 155.692 -5.5% -2.0%
test_benchmark_query4 13.931 13.661 13.760 14.615 +2.8% -1.9%
test_benchmark_query5 69.105 69.061 67.924 69.868 -0.3% -0.1%
test_benchmark_query6 26.081 23.877 25.086 22.611 -4.5% -8.5%
test_benchmark_query7 14.055 13.851 14.426 13.930 +1.6% -1.5%
test_benchmark_query8 3.518 3.459 3.652 3.470 +2.1% -1.7%
test_benchmark_query9 220.737 214.122 210.543 209.177 -3.5% -3.0%
test_benchmark_query10 22.872 22.468 22.991 23.578 +2.7% -1.8%
test_benchmark_query11 6.104 5.836 5.748 5.746 -3.7% -4.4%
test_benchmark_query12 19.011 18.362 18.267 18.296 -2.2% -3.4%
test_benchmark_query13 1.475 1.500 1.558 1.472 +1.9% +1.7%
test_benchmark_query14 259.999 261.421 260.151 262.994 +0.3% +0.5%

Geometric mean of per-query branch/main ratios: 0.9991.

Large shape suite · headlines, all 50 cases in both modes, peak memory and indexes

memory: large graph (200,000 accounts, 2,338,886 T edges, hub degrees [10, 1000, 10000, 100000])

Runs: main x2, branch x2.

Group Headline Ideal main branch
phrasing slowest / fastest of 8 phrasings 1 14.27x 14.60x
selectivity two filters: slowest / fastest end 1 43.99x 46.62x
selectivity hop order: slowest / fastest 1 6.30x 5.96x
count_rows slowest count / fastest rows <= 1 19.90x 20.43x
hubs cycle: degree 100000 / degree 10 1 1.00x 1.07x
hubs cycle, hub at both ends: degree 100000 / 10 1 22.58x 21.04x
hubs pattern predicate: degree 100000 / 10 1 1.01x 1.01x
hubs cycle at degree 100000: CSR / join <= 1 0.29x 0.30x
hubs predicate at degree 100000: CSR / join <= 1 0.05x 0.05x
optional filtered / unfiltered OPTIONAL MATCH <= 1 1.05x 1.03x
optional filtered OPTIONAL MATCH / filtered MATCH about 1 0.99x 0.95x
wide_columns cross_filter: notes / ids about 1 5.52x 5.67x
wide_columns top_k: notes / ids about 1 3.55x 3.39x
wide_columns far_filter: notes / ids about 1 1.65x 1.47x
wide_columns all: notes / ids > 1 5.09x 5.29x
early_exit LIMIT 10 / all rows, ids << 1 0.10x 0.10x
early_exit LIMIT 10 / all rows, notes << 1 0.70x 0.64x
Query main ms branch ms Change main peak MiB branch peak MiB
phrasing/unnamed_start_inline 0.51 0.51 +0% 1.9 1.8
phrasing/unnamed_start_where 0.53 0.52 -3% 1.8 1.9
phrasing/unnamed_end_inline 0.51 0.51 +1% 1.7 1.9
phrasing/unnamed_end_where 0.52 0.53 +1% 1.9 1.7
phrasing/named_start_inline 6.93 7.04 +2% 66.4 67.2
phrasing/named_start_where 7.26 7.47 +3% 66.2 66.3
phrasing/named_end_inline 7.00 7.01 +0% 67.1 78.8
phrasing/named_end_where 7.13 7.23 +1% 65.7 65.3
selectivity/rows_fwd 39.99 42.16 +5% 10.5 10.8
selectivity/rows_rev 0.91 0.90 -1% 2.3 2.3
selectivity/hop_cheap_first 1.06 1.15 +8% 2.6 2.6
selectivity/hop_hub_first 6.71 6.83 +2% 2.7 3.2
count_rows/count_fwd 18.09 18.48 +2% 13.2 15.9
count_rows/count_rev 17.65 17.49 -1% 12.8 12.8
hubs/cycle_10 1.13 1.12 -1% 3.0 3.0
hubs/cycle_join_10 1.62 1.70 +5% 4.0 4.0
hubs/both_hubs_10 1.09 1.18 +8% 2.7 2.5
hubs/predicate_10 0.63 0.60 -5% 2.1 2.3
hubs/predicate_join_10 3.56 3.31 -7% 9.2 8.0
hubs/cycle_1000 1.13 1.19 +5% 3.0 2.8
hubs/cycle_join_1000 1.62 1.75 +8% 4.3 3.8
hubs/both_hubs_1000 1.30 1.21 -6% 2.8 2.7
hubs/predicate_1000 0.62 0.60 -3% 2.2 2.2
hubs/predicate_join_1000 3.44 3.40 -1% 9.7 9.4
hubs/cycle_10000 1.15 1.12 -2% 2.9 2.7
hubs/cycle_join_10000 2.08 2.11 +2% 7.4 7.4
hubs/both_hubs_10000 3.27 3.28 +1% 2.7 2.7
hubs/predicate_10000 0.59 0.63 +6% 2.5 2.0
hubs/predicate_join_10000 4.36 4.48 +3% 20.3 20.8
hubs/cycle_100000 1.12 1.19 +6% 2.8 3.1
hubs/cycle_join_100000 3.91 4.00 +2% 25.8 30.8
hubs/both_hubs_100000 24.69 24.82 +1% 2.5 2.6
hubs/predicate_100000 0.64 0.60 -5% 2.1 2.2
hubs/predicate_join_100000 11.89 11.91 +0% 77.9 78.8
optional/match 0.69 0.71 +3% 4.0 3.7
optional/optional 0.76 0.77 +1% 4.6 3.4
optional/optional_where 0.80 0.79 -1% 3.5 3.5
optional/match_where 0.80 0.84 +4% 3.2 3.4
wide_columns/far_filter_ids 5.67 6.26 +10% 9.8 12.5
wide_columns/far_filter_notes 9.36 9.21 -2% 199.4 200.3
wide_columns/cross_filter_ids 2.42 2.29 -5% 7.6 6.6
wide_columns/cross_filter_notes 13.34 12.97 -3% 216.1 229.2
wide_columns/top_k_ids 2.30 2.38 +3% 4.9 4.9
wide_columns/top_k_notes 8.17 8.08 -1% 59.7 58.5
wide_columns/all_ids 2.16 2.12 -2% 6.2 6.4
wide_columns/all_notes 10.98 11.23 +2% 129.7 127.1
early_exit/hop_limit_ids 0.50 0.47 -5% 3.9 4.0
early_exit/hop_all_ids 4.79 4.84 +1% 26.0 24.4
early_exit/hop_limit_notes 0.57 0.52 -9% 5.3 4.8
early_exit/hop_all_notes 0.82 0.81 -1% 8.0 10.3
Index main MiB branch MiB main build ms branch build ms
account 205.2 203.5 222 212
ring 32.0 30.1 26 26

main run-to-run geomean: 1.002; largest single-query gap 24%.

lazy: large graph (200,000 accounts, 2,338,886 T edges, hub degrees [10, 1000, 10000, 100000])

Runs: main x2, branch x2.

Group Headline Ideal main branch
phrasing slowest / fastest of 8 phrasings 1 22.80x 23.11x
selectivity two filters: slowest / fastest end 1 24.21x 23.85x
selectivity hop order: slowest / fastest 1 3.50x 3.35x
count_rows slowest count / fastest rows <= 1 13.44x 13.31x
hubs cycle: degree 100000 / degree 10 1 1.00x 1.02x
hubs cycle, hub at both ends: degree 100000 / 10 1 16.95x 19.18x
hubs pattern predicate: degree 100000 / 10 1 1.03x 1.10x
hubs cycle at degree 100000: CSR / join <= 1 0.30x 0.33x
hubs predicate at degree 100000: CSR / join <= 1 0.10x 0.10x
optional filtered / unfiltered OPTIONAL MATCH <= 1 3.42x 3.46x
optional filtered OPTIONAL MATCH / filtered MATCH about 1 0.98x 0.98x
wide_columns cross_filter: notes / ids about 1 59.42x 60.96x
wide_columns top_k: notes / ids about 1 50.33x 51.58x
wide_columns far_filter: notes / ids about 1 29.51x 29.18x
wide_columns all: notes / ids > 1 58.63x 62.90x
early_exit LIMIT 10 / all rows, ids << 1 0.14x 0.15x
early_exit LIMIT 10 / all rows, notes << 1 0.55x 0.44x
Query main ms branch ms Change main peak MiB branch peak MiB
phrasing/unnamed_start_inline 0.89 0.88 -1% 2.7 2.5
phrasing/unnamed_start_where 0.89 0.89 -1% 2.5 2.5
phrasing/unnamed_end_inline 0.96 0.87 -9% 2.8 2.5
phrasing/unnamed_end_where 0.89 0.98 +10% 2.7 2.7
phrasing/named_start_inline 19.75 19.70 -0% 833.1 824.4
phrasing/named_start_where 19.87 19.86 -0% 822.8 832.1
phrasing/named_end_inline 19.29 19.59 +2% 828.2 833.4
phrasing/named_end_where 20.21 20.06 -1% 835.9 832.3
selectivity/rows_fwd 55.79 55.89 +0% 45.8 38.3
selectivity/rows_rev 2.30 2.34 +2% 8.9 9.6
selectivity/hop_cheap_first 2.43 2.46 +1% 9.2 8.5
selectivity/hop_hub_first 8.51 8.24 -3% 9.5 9.3
count_rows/count_fwd 30.97 31.20 +1% 62.1 67.2
count_rows/count_rev 30.44 30.58 +0% 37.0 45.6
hubs/cycle_10 2.00 2.00 +0% 6.7 5.8
hubs/cycle_join_10 3.42 3.47 +1% 12.2 10.5
hubs/both_hubs_10 1.55 1.56 +0% 3.5 3.8
hubs/predicate_10 1.48 1.41 -4% 6.0 6.1
hubs/predicate_join_10 6.24 5.81 -7% 31.0 28.1
hubs/cycle_1000 2.18 1.98 -9% 6.5 6.5
hubs/cycle_join_1000 3.61 3.68 +2% 12.2 11.8
hubs/both_hubs_1000 1.76 1.81 +3% 4.4 4.9
hubs/predicate_1000 1.53 1.37 -10% 5.4 5.1
hubs/predicate_join_1000 5.99 6.36 +6% 38.4 31.8
hubs/cycle_10000 1.98 1.98 -0% 8.8 6.5
hubs/cycle_join_10000 3.85 3.86 +0% 16.8 16.2
hubs/both_hubs_10000 3.94 4.27 +8% 4.0 3.5
hubs/predicate_10000 1.41 1.38 -2% 5.8 5.9
hubs/predicate_join_10000 6.84 6.69 -2% 39.9 36.7
hubs/cycle_100000 2.01 2.05 +2% 6.5 8.2
hubs/cycle_join_100000 6.69 6.23 -7% 49.9 37.5
hubs/both_hubs_100000 26.26 29.87 +14% 4.7 4.6
hubs/predicate_100000 1.53 1.56 +2% 7.4 5.8
hubs/predicate_join_100000 14.94 14.85 -1% 86.5 84.4
optional/match 1.22 1.20 -1% 5.6 5.4
optional/optional 1.28 1.26 -1% 4.7 5.3
optional/optional_where 4.36 4.35 -0% 18.7 18.5
optional/match_where 4.44 4.44 +0% 21.1 10.6
wide_columns/far_filter_ids 11.40 11.67 +2% 28.2 27.9
wide_columns/far_filter_notes 336.42 340.52 +1% 847.8 849.1
wide_columns/cross_filter_ids 2.99 2.96 -1% 15.0 12.5
wide_columns/cross_filter_notes 177.48 180.71 +2% 1059.7 1074.6
wide_columns/top_k_ids 3.22 3.35 +4% 8.0 9.4
wide_columns/top_k_notes 162.22 172.57 +6% 896.8 905.1
wide_columns/all_ids 2.97 2.81 -5% 15.7 19.3
wide_columns/all_notes 173.88 176.46 +1% 1098.0 1093.7
early_exit/hop_limit_ids 0.75 0.76 +2% 8.7 8.2
early_exit/hop_all_ids 5.34 5.12 -4% 51.8 44.3
early_exit/hop_limit_notes 54.37 50.54 -7% 24.0 23.6
early_exit/hop_all_notes 98.55 115.39 +17% 83.8 84.6
Index main MiB branch MiB main build ms branch build ms
account 203.9 196.1 212 211
ring 30.8 28.8 26 27

main run-to-run geomean: 1.002; largest single-query gap 21%.

Fixed-length interest queries · execution and planning times with CSR on and off

The graph has 10,000 nodes and 30,000 relationships. Three types connect each pair of adjacent nodes. Each sample follows a warmup. Each cell is the mean of two runs' nine-sample medians, in milliseconds.

Mode Query Rows Main execution ms Branch execution ms Main explain ms Branch explain ms
memory-csr-False one_control 10000 1.05 1.04 0.39 0.39
memory-csr-False union_control 30000 2.10 2.11 1.23 1.21
memory-csr-False unused_multi 20000 1.33 1.35 0.67 0.65
memory-csr-False unused_untyped 30000 9.04 8.91 0.68 0.68
memory-csr-False one 10000 — 1.09 — 0.51
memory-csr-False multi 30000 — 2.24 — 1.24
memory-csr-False untyped 30000 — 9.14 — 0.84
memory-csr-True one_control 10000 0.57 0.58 0.25 0.25
memory-csr-True union_control 30000 1.20 1.18 0.72 0.70
memory-csr-True unused_multi 20000 0.74 0.75 0.37 0.37
memory-csr-True unused_untyped 30000 9.81 9.63 0.60 0.60
memory-csr-True one 10000 — 0.74 — 0.35
memory-csr-True multi 30000 — 1.52 — 0.82
memory-csr-True untyped 30000 — 10.50 — 0.78
lazy-csr-False one_control 10000 1.12 1.25 0.49 0.49
lazy-csr-False union_control 30000 2.60 2.78 1.52 1.55
lazy-csr-False unused_multi 20000 1.65 1.76 0.82 0.84
lazy-csr-False unused_untyped 30000 9.28 9.66 0.87 0.87
lazy-csr-False one 10000 — 1.39 — 0.61
lazy-csr-False multi 30000 — 2.98 — 1.63
lazy-csr-False untyped 30000 — 10.28 — 1.11
lazy-csr-True one_control 10000 0.80 0.79 0.26 0.25
lazy-csr-True union_control 30000 1.52 1.52 0.81 0.80
lazy-csr-True unused_multi 20000 1.00 0.99 0.42 0.43
lazy-csr-True unused_untyped 30000 10.29 10.35 0.72 0.70
lazy-csr-True one 10000 — 0.93 — 0.37
lazy-csr-True multi 30000 — 1.77 — 0.93
lazy-csr-True untyped 30000 — 10.50 — 0.95

The SF1 runners used standard cbd6d62 and complex dfec30d.

User impact

Queries can read a fixed-length relationship’s configured type directly in Cypher. The Cypher guide includes an executable example, and the optimizer guide describes when the planner carries the type. The existing node labels() behavior and 64-combination limit are preserved. Variable-length relationship lists are outside this feature’s scope.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-28T15:43:35.941301Z 162e9d4 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 162e9d480d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 221 to 222
expression: super::super::expression::bind_value(&p.expression, &schema, types),
alias: p.alias.clone(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve unaliased relationship functions in aggregate output

For a flat typed match such as MATCH (a:Person)-[r:KNOWS]->(b:Person) RETURN type(r), count(*) AS n, this binding replaces type(r) with @type__r while leaving its alias unset. The final aggregate projection then derives the output name from that bound expression, so drop_relationship_types removes the explicitly requested type result and returns only n. Preserve the original expression's display name before binding; unaliased labels(r) also needs its original name retained rather than becoming expr.

Useful? React with 👍 / 👎.

When a fixed-length type(r) or labels(r) binds to the planner's private
type column, keep the source expression's Cypher name for the aggregate
output. This also keeps the private name out of nested aggregate names.

Add regression tests for output columns, values, and counts with CSR
enabled and disabled, and cover explicit alias normalization.

Validation: 765 Rust and 1,888 Python tests passed. On 100,000 fixed
relationships, the corrected query grouping by both functions took
2.11 ms with CSR and 2.82 ms with joins. Its explicitly aliased
equivalent measured 2.10 ms and 2.97 ms. Values are the averages
of two 15-sample warmed medians on the corrected release wheel.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support type(r) for relationship variables

1 participant